﻿using System;
using System.Web.Mvc;
using ActionHandlers.Bisness;
using ValidationAction;
using ValidationAction.Mvc;

namespace ActionHandlers.Controllers
{
    public class MainController : Controller
    {
        public ActionResult Index()
        {
            return new ValidationActionResult(() => new ResultAction())
                .Success(x => {
                    int value = (int) x; 
                    return View("Index", value);
                })
                .Error(y => View("Error", y));
        }

    }
}
